package com.gt.self.controller;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class taskSchedulerController {

    @Scheduled(fixedDelay = 1000)
    private void handleTask()  {
        String name = Thread.currentThread().getName();
        System.out.println(name);
        System.out.println("处理任务");
    }

    @Scheduled(fixedDelay = 1000)
    private void handleTask1(){
        String name = Thread.currentThread().getName();
        System.out.println(name);
        System.out.println("处理任务1");
    }

}
